[CELEBORN-1315] Manually close the RocksDB/LevelDB instance when checkVersion throw Exception#2369
Closed
SteNicholas wants to merge 1 commit intoapache:mainfrom
Closed
[CELEBORN-1315] Manually close the RocksDB/LevelDB instance when checkVersion throw Exception#2369SteNicholas wants to merge 1 commit intoapache:mainfrom
SteNicholas wants to merge 1 commit intoapache:mainfrom
Conversation
…kVersion throw Exception
FMX
approved these changes
Mar 8, 2024
Contributor
FMX
left a comment
There was a problem hiding this comment.
LGTM. Merged into main(v0.5.0).
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## main #2369 +/- ##
==========================================
- Coverage 48.85% 48.84% -0.00%
==========================================
Files 208 208
Lines 12984 12984
Branches 1115 1115
==========================================
- Hits 6342 6341 -1
Misses 6232 6232
- Partials 410 411 +1 ☔ View full report in Codecov by Sentry. |
SteNicholas
added a commit
that referenced
this pull request
Apr 23, 2024
…kVersion throw Exception ### What changes were proposed in this pull request? Should close the `RocksDB`/`LevelDB` instance when `checkVersion` throw Exception. Backport [[SPARK-46389][CORE] Manually close the RocksDB/LevelDB instance when checkVersion throw Exception](apache/spark#44327). ### Why are the changes needed? In the process of initializing the DB in `RocksDBProvider`/`LevelDBProvider`, there is a `checkVersion` step that may throw an exception. After the exception is thrown, the upper-level caller cannot hold the already opened RockDB/LevelDB instance, so it cannot perform resource cleanup, which poses a potential risk of handle leakage. So this PR manually closes the `RocksDB`/`LevelDB` instance when `checkVersion` throws an exception. ### Does this PR introduce _any_ user-facing change? No. ### How was this patch tested? CI. Closes #2369 from SteNicholas/CELEBORN-1315. Authored-by: SteNicholas <programgeek@163.com> Signed-off-by: mingji <fengmingxiao.fmx@alibaba-inc.com>
SteNicholas
added a commit
that referenced
this pull request
Apr 23, 2024
…kVersion throw Exception ### What changes were proposed in this pull request? Should close the `RocksDB`/`LevelDB` instance when `checkVersion` throw Exception. Backport [[SPARK-46389][CORE] Manually close the RocksDB/LevelDB instance when checkVersion throw Exception](apache/spark#44327). ### Why are the changes needed? In the process of initializing the DB in `RocksDBProvider`/`LevelDBProvider`, there is a `checkVersion` step that may throw an exception. After the exception is thrown, the upper-level caller cannot hold the already opened RockDB/LevelDB instance, so it cannot perform resource cleanup, which poses a potential risk of handle leakage. So this PR manually closes the `RocksDB`/`LevelDB` instance when `checkVersion` throws an exception. ### Does this PR introduce _any_ user-facing change? No. ### How was this patch tested? CI. Closes #2369 from SteNicholas/CELEBORN-1315. Authored-by: SteNicholas <programgeek@163.com> Signed-off-by: mingji <fengmingxiao.fmx@alibaba-inc.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What changes were proposed in this pull request?
Should close the
RocksDB/LevelDBinstance whencheckVersionthrow Exception.Backport [SPARK-46389][CORE] Manually close the RocksDB/LevelDB instance when checkVersion throw Exception.
Why are the changes needed?
In the process of initializing the DB in
RocksDBProvider/LevelDBProvider, there is acheckVersionstep that may throw an exception. After the exception is thrown, the upper-level caller cannot hold the already opened RockDB/LevelDB instance, so it cannot perform resource cleanup, which poses a potential risk of handle leakage. So this PR manually closes theRocksDB/LevelDBinstance whencheckVersionthrows an exception.Does this PR introduce any user-facing change?
No.
How was this patch tested?
CI.